Hive: Introduce HiveMetastoreExtension for Hive tests#9282
Hive: Introduce HiveMetastoreExtension for Hive tests#9282nastra merged 3 commits intoapache:mainfrom
Conversation
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java
Outdated
Show resolved
Hide resolved
hive-metastore/src/test/java/org/apache/iceberg/hive/HiveTableBaseTest.java
Outdated
Show resolved
Hide resolved
hive-metastore/src/test/java/org/apache/iceberg/hive/HiveTableBaseTest.java
Outdated
Show resolved
Hide resolved
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCommitLocks.java
Outdated
Show resolved
Hide resolved
hive-metastore/src/test/java/org/apache/iceberg/hive/TestCachedClientPool.java
Show resolved
Hide resolved
hive-metastore/src/test/java/org/apache/iceberg/hive/TestCachedClientPool.java
Outdated
Show resolved
Hide resolved
hive-metastore/src/test/java/org/apache/iceberg/hive/TestCachedClientPool.java
Outdated
Show resolved
Hide resolved
hive-metastore/src/test/java/org/apache/iceberg/hive/TestCachedClientPool.java
Outdated
Show resolved
Hide resolved
681ede8 to
c59e4d3
Compare
hive-metastore/src/test/java/org/apache/iceberg/hive/TestCachedClientPool.java
Outdated
Show resolved
Hide resolved
hive-metastore/src/test/java/org/apache/iceberg/hive/TestCachedClientPool.java
Outdated
Show resolved
Hide resolved
c59e4d3 to
13fde54
Compare
13fde54 to
cde7dd8
Compare
|
Let me take a look |
hive-metastore/src/test/java/org/apache/iceberg/hive/HiveMetastoreExtension.java
Outdated
Show resolved
Hide resolved
|
|
||
| @BeforeEach | ||
| public void createTableLocation() throws IOException { | ||
| catalog = |
There was a problem hiding this comment.
I think we should initialize the catalog only once. Not for each tests as nothing changes between tests related to catalog config.
There was a problem hiding this comment.
Also can we move this to HiveMetastoreExtension and get the catalog from there? It can help in duplicating this code in each test class which uses this extension.
There was a problem hiding this comment.
As consistency with other catalog tests which initialise before each test and drop the catalog after every test. For Hive also the idea is same.
There was a problem hiding this comment.
Also can we move this to
HiveMetastoreExtensionand get the catalog from there? It can help in duplicating this code in each test class which uses this extension.
I don't think the catalog initialization should be moved into HiveMetastoreExtension. The sole purpose of HiveMetastoreExtension is to provide the metastore part
There was a problem hiding this comment.
Sorry, I wanted your thoughts on this comment
#9282 (comment)
hive-metastore/src/test/java/org/apache/iceberg/hive/HiveMetastoreExtension.java
Outdated
Show resolved
Hide resolved
|
|
||
| @BeforeEach | ||
| public void createTableLocation() throws IOException { | ||
| catalog = |
There was a problem hiding this comment.
Also can we move this to HiveMetastoreExtension and get the catalog from there? It can help in duplicating this code in each test class which uses this extension.
| CachedClientPool.clientPoolCache() | ||
| .getIfPresent(CachedClientPool.extractKey(null, hiveConf))) | ||
| .getIfPresent( | ||
| CachedClientPool.extractKey(null, HIVE_METASTORE_EXTENSION.hiveConf()))) |
There was a problem hiding this comment.
nit: some test we are extracting to a variable and in some test we are using directly. Let us have a unified style.
There was a problem hiding this comment.
At other test hiveConf was being used at multiple places, that's the reason I created a local variable.
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCommitLocks.java
Outdated
Show resolved
Hide resolved
cde7dd8 to
d1f48bf
Compare
1825954 to
521fde4
Compare
521fde4 to
c81e2b3
Compare
Co-authored-by: Eduard Tudenhoefner <etudenhoefner@gmail.com>
Co-authored-by: Eduard Tudenhoefner <etudenhoefner@gmail.com>
Co-authored-by: Eduard Tudenhoefner <etudenhoefner@gmail.com>
CC: @nastra